home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
ooptut34.zip
/
TP
/
OOPTUTOR
/
STAFFOBJ.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-31
|
1KB
|
61 lines
unit staffobj;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{ Unit as part of the illustration of Virtual Methods. }
{ }
{ STAFFOBJ.PAS -> STAFFOBJ.TPU R. Shaw 26.4.91 }
{_____________________________________________________________________}
interface
uses Crt;
type
staff = object
Name : string;
constructor Init(SurName : string );
procedure script1; virtual; {virtual procedures which are }
procedure script2; virtual; {overridden in the object junior}
procedure action1; {static procedures which are inherited}
procedure action2; {by the descendant object junior. }
end;
var
LetterName : string;
implementation
constructor staff.Init( SurName : string );
begin
Name := SurName;
end;
procedure staff.script1;
begin
writeln( Name,
': Please send the duplicated letters to all our customers.');
writeln( ' If you have a problem, please ask me.');
end;
procedure staff.script2;
begin
LetterName := 'OD';
writeln(Name,': The letter is headed ',LetterName,'.');
writeln;
end;
procedure staff.action1;
begin
script1;
end;
procedure staff.action2;
begin
script2;
end;
end.
{ end of listing }